package com.test.study.ToolsUtils.strom.workdsum;

import org.apache.storm.Config;
import org.apache.storm.LocalCluster;
import org.apache.storm.topology.TopologyBuilder;

public class DataTopoloy {

	public static void main(String[] args) {
		// 组装topology
		//一个work  3个线程 3个task
		TopologyBuilder topologyBuilder = new TopologyBuilder();
		topologyBuilder.setSpout("file", new DataSourceSpout());
		topologyBuilder.setBolt("line", new DataBolt()).shuffleGrouping("file");
		topologyBuilder.setBolt("word", new WorkBolt()).shuffleGrouping("line");
		// 使用本地测试
		Config config = new Config();
	//	config.put(Config.WORKER_LOG_LEVEL_RESET_POLL_SECS, 30);//
		LocalCluster localCluster = new LocalCluster();
		localCluster.submitTopology("topologyLocal",config , topologyBuilder.createTopology());

	}

}
